package tests;

import common.AutoTestUtil;
import org.openqa.selenium.By;

import java.io.IOException;

public class PageIndex extends AutoTestUtil {
    /**
     * 博客界面测试
     * @throws NoSuchMethodException
     * @throws IOException
     */
    public void successIndex() throws NoSuchMethodException, IOException {
        String src = this.getClass().getMethod("successIndex").getName();
        getScreen(src);
        //此时已经成功的登录的，不必再次进行url获取
        try {
            driver.findElement(By.cssSelector("#article_list_board_title"));
            driver.findElement(By.cssSelector("#artical-items-body > div:nth-child(1) > div > div.col > div.text-truncate > a > strong"));
            driver.findElement(By.cssSelector("#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post"));
        }catch (Exception e){
            System.out.println("successIndex方法出现了异常：" + e);
        }
    }
}
